import requests,time
from TS.common.thisisurl import url
class TinyShop:
    def __init__(self):
        s = requests.session()
        self.s = s

    def login(self,a):
        u=url()
        get_url=u.url()

        self.s.get(url="%s/index.php?con=admin&act=captcha&h=40&w=120&bc=3f4657&c=ffffff"%get_url)
        url_lgin = "%s/index.php?con=admin&act=check"%get_url
        # data = {"name":"admin","password":"123456"}
        we = self.s.post(url=url_lgin,data=a)
        # cd = we.text
        return  we.text,self.s
        # if "退出" in cd:
        #     print("login pass")
        # else:
        #     print("login failed")

if  __name__ =="__main__":
    TinyShop()